<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button v-on:click="hello('hello')">hello</button>
        <button @click="hello('难受')">难受</button>
        <button @click="num++"></button>
        <div @click.slef="hello('1')"  style="background: red; width: 800px; height: 500px;padding: 50px;">
        1
        <div @click.stop="hello('2')" style="background:blue; width: 400px; height: 200px;padding: 50px;">
        2
       <a @click.stop.prevent="hello('3')" style="background: yellow; width: 200px; height: 100px;display: block;padding: 50px;"
        href="www.baidu.com">
        3
       </a>
       </div>
       </div>

       <input type="text" v-on:keyup="hello('keyup')">
    </div>
</body>

<script src="./node_modules/vue/dist/vue.js"></script>
<script>
     new Vue({
        el: "#app",
        data() {
            return {
                num: 0,
            }
        },
        methods: {
            hello(str){
                alert(str)
            }
        },
     })

     /**
      * 
      * v-on  用于绑定事件
      * v-on：事件名
      * 
      * */
</script>
</html>